"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.responseJson = void 0;
function responseJson(response, msg) {
    let r = '{"ERROR":"INTERNAL"}';
    let cType = "text/html";
    if (typeof msg === "string") {
        r = msg;
        cType = "text/plain";
    }
    if (typeof msg === "object") {
        r = JSON.stringify(msg);
        cType = "application/json";
    }
    response.writeHead(200, { "Content-Type": cType });
    response.write(r);
    response.end();
}
exports.responseJson = responseJson;
